--- Classification of literals.
module frege.compiler.enums.Literals where 

{--
    type tag for Literals
 -}
data Literalkind =
      LBool             --- 'Bool', either true or false
    | LChar             --- 'Char'
    | LString           --- 'String'
    | LInt              --- 'Int' literal, subject to limits
    | LBig              --- 'Integer' literal, arbitrary length
    | LLong             --- 'Long' literal, subject to limits
    | LFloat            --- 'Float' literal
    | LDouble           --- 'Double' literal
    | LDec              --- 'Decimal' literal, subject to limits 
    | LRegex            --- 'Regex' literal

--- tells us whether a literal of this kind can be negated
isLiteralNumeric ∷ Literalkind → Bool
isLiteralNumeric lk = lk >= LInt && lk <= LDec

derive Enum Literalkind


derive Show Literalkind
